import time
def schet (numbers):
    sw = true
    while sw:
        sw = False
        for i in range(len(numbers)-1):
            if numbers [i] > numbers [i+1]:
               numbers [i], numbers [i+1]=numbers[i+1], numbers[i]
               sw = True
def rdfr(filename):
    file = open(filename, 'r')
    data=file.lines()
    return data
m1=rdfr("m1_sorted.txt")
m2=rdfr("m2_sorted.txt")
m3=rdfr ("m3_sorted.txt")
t_start = time.time()
schet (m1)
t_finish=time.time()
print("m1_sorted",round((t_finish-t_start)*1000), "millistconds" )
t_start = time.time()
schet (m2)
t_finish=time.time()
print("m2_reserve",round((t_finish-t_start)*1000), "millistconds")
t_start = time.time()
schet (m3)
t_finish=time.time()
print("m3_shuffle",round((t_finish-t_start)*1000), "millistconds")

